require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 1,["5"] = 1,["6"] = 1,["8"] = 8,["9"] = 9,["10"] = 10,["11"] = 5,["12"] = 14,["13"] = 15,["14"] = 16,["15"] = 17,["16"] = 18,["17"] = 19,["18"] = 20,["19"] = 21,["21"] = 23,["22"] = 24,["24"] = 26,["25"] = 27,["28"] = 14,["29"] = 3,["30"] = 1});
local ____exports = {}
____exports.default = __TS__Class()
local AddProperty2UnitOwnerOnUseAbilityState = ____exports.default
AddProperty2UnitOwnerOnUseAbilityState.name = "AddProperty2UnitOwnerOnUseAbilityState"
function AddProperty2UnitOwnerOnUseAbilityState.prototype.____constructor(self)
    local triggerHandle = CreateTrigger()
    TriggerRegisterAnyUnitEventBJ(triggerHandle, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    TriggerAddAction(triggerHandle, self.action)
end
function AddProperty2UnitOwnerOnUseAbilityState.prototype.action()
    local spellAbilityIdStr = id2string(GetSpellAbilityId())
    local cfgData = ____exports.default.config[spellAbilityIdStr]
    if cfgData then
        local unit = GetTriggerUnit()
        local player = GetOwningPlayer(unit)
        if cfgData.addGold then
            AdjustPlayerStateBJ(cfgData.addGold, player, PLAYER_STATE_RESOURCE_GOLD)
        end
        if cfgData.addLumber then
            AdjustPlayerStateBJ(cfgData.addLumber, player, PLAYER_STATE_RESOURCE_LUMBER)
        end
        if cfgData.addFood then
            AdjustPlayerStateBJ(cfgData.addFood, player, PLAYER_STATE_RESOURCE_FOOD_CAP)
        end
    end
end
AddProperty2UnitOwnerOnUseAbilityState.config = {}
____exports.default = AddProperty2UnitOwnerOnUseAbilityState
return ____exports
